#!/usr/bin/env bash

readonly BASH_COMPLETION_DIR="$(realpath ".")"
readonly BASH_COMPLETION_FILE=$BASH_COMPLETION_DIR/.xtask_bash_completion 

# defaults to writing .xtask_bash_completion in current directory
./scripts/xtask completion

echo "
Wrote the bash completion file for xtask to ${BASH_COMPLETION_FILE}
Please source this file in your .bashrc, e.g., through
  
echo \"
#activate xtask auto-complete
if [ -f ${BASH_COMPLETION_FILE} ]; then
  source ${BASH_COMPLETION_FILE}
fi\" >> ~/.bashrc
"
